<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head>
	<title></title>

	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<!-- 引入bootstrap -->
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
	<!-- 引入JQuery  bootstrap.js-->
	<script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
</head>
<body>

<script type="text/javascript">
    //利用ajax进行工号校验
    $(function() {
        $("#inputEmail3").blur(function () {
                var collegeID = $(this).val();
                if (collegeID == "") {
                    alert("请先填写部门编号")
                }
                else {
                    var url = "<%=request.getContextPath()%>/admin/checkcollegeID.html";  // 请求的url
                    $.post(
                        url,
                        {'collegeID': collegeID},
                        function (data) {
                            if (data == "exist") {
                                alert("课程部门已存在");
                            }
                        }
                    );
                }
            }
        );
    });

</script>
	<!-- 顶栏 -->
	<jsp:include page="top.jsp"></jsp:include>
	<!-- 中间主体 -->
		<div class="container" id="content">
		<div class="row">
			<jsp:include page="menu.jsp"></jsp:include>
			<div class="col-md-10">
				<div class="panel panel-default">
				    <div class="panel-heading">
						<div class="row">
					    	<h1 style="text-align: center;">添加部门信息</h1>
						</div>
				    </div>
				    <div class="panel-body">
						<form class="form-horizontal" role="form" action="${pageContext.request.contextPath}/admin/addCollegeed.html" id="editfrom" method="post">
							  <div class="form-group">
							    <label for="inputEmail3" class="col-sm-2 control-label">部门编号</label>
							    <div class="col-sm-10">
							      <input type="number" class="form-control" id="inputEmail3" name="collegeID" placeholder="请输入部门编号">
							    </div>
							  </div>
							  <div class="form-group">
							    <label for="inputPassword3" class="col-sm-2 control-label">部门名</label>
							    <div class="col-sm-10">
							      <input  type="text" class="form-control" id="inputPassword3" name="collegeName" placeholder="请输入部门名" >
							    </div>
							  </div>

							<div class="form-group">
								<label for="inputPassword4" class="col-sm-2 control-label">基本工资</label>
								<div class="col-sm-10">
									<input  type="text" class="form-control" id="inputPassword4" name="salary" placeholder="请输入基本工资" >
								</div>
							</div>
							  <div class="form-group" style="text-align: center">
								<button class="btn btn-default" type="submit">保存</button>
							  </div>
						</form>
				    </div>

				</div>

			</div>
		</div>
	</div>
	<div class="container" id="footer">
	<div class="row">
		<div class="col-md-12"></div>
	</div>
	</div>
</body>
	<script type="text/javascript">
		$("#nav li:nth-child(7)").addClass("active")
		/* 批量添加 */
		$("#addMany").click(function(){
			window.location.href="${pageContext.request.contextPath}/up.jsp";
		})
	</script>
</html>
